package com.clw.commander;

/**
 * Created by chengliwei on 2018/12/11.
 */
public class CmdOption {

    private String shortName;
    private String verboseName;
    private String value;
    private String help;
    private boolean needValue;
    private boolean parsed;

    public String getShortName() {
        return shortName;
    }

    public void setShortName(String shortName) {
        this.shortName = shortName;
    }

    public String getVerboseName() {
        return verboseName;
    }

    public void setVerboseName(String verboseName) {
        this.verboseName = verboseName;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getHelp() {
        return help;
    }

    public void setHelp(String help) {
        this.help = help;
    }

    public boolean isNeedValue() {
        return needValue;
    }

    public void setNeedValue(boolean needValue) {
        this.needValue = needValue;
    }

    public boolean isParsed() {
        return parsed;
    }

    public void setParsed(boolean parsed) {
        this.parsed = parsed;
    }

    @Override
    public String toString() {
        return "CmdOption{" +
                "shortName='" + shortName + '\'' +
                ", verboseName='" + verboseName + '\'' +
                ", value='" + value + '\'' +
                ", help='" + help + '\'' +
                ", needValue=" + needValue +
                '}';
    }

    public String helpString() {
        return String.format("%4s %-10s %s", getShortName(), getVerboseName(), getHelp());
    }
}
